#ifndef _MINBASICLIB_NET_SOCKET_H_
#define _MINBASICLIB_NET_SOCKET_H_

#include <global/types.h>
#include <global/const.h>

int sock_toaddr(const char * host, unsigned short port, struct sockaddr_in * addr);

char * sock_addr(struct sockaddr_in * addr);

char * sock_ip(struct sockaddr_in * addr);

char * sock_iip(unsigned int ip);

unsigned short sock_port(struct sockaddr_in * addr);

int sock_rbuf(t_socket so, int sz);

int sock_wbuf(t_socket so, int sz);

int sock_reuse(t_socket so, int opt);

int sock_error(t_socket so);

int sock_block(t_socket so, t_bool block);

#endif
